package com.erclab.xpresso.util
{
	import com.erclab.xpresso.FormManager;
	import com.erclab.xpresso.formelements.FormElement;
	import mx.collections.ArrayCollection;
	
	public class FormUtil{
		
		public static function getFormElement(theForm:FormManager, elementName:String):FormElement{
			var elements:ArrayCollection = theForm.getFormElements();
			for (var i:int = 0; i < elements.length; i++){
				var element:FormElement = elements.getItemAt(i) as FormElement;
				if (element.getAttribute("destinationColumn") == elementName){
					return element;
				}
			}
			return null;
		}
	}
		
}